package com.dobby.logger.system.task;

import com.dobby.logger.utils.CommonUtils;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

import java.util.Date;

/**
 * Created by liguoqing on 2016/3/7.
 */
public class QuartzTask extends QuartzJobBean {

    private  static  final Logger logger = LoggerFactory.getLogger(QuartzTask.class);

    private void work () {
        String status = CommonUtils.findProperties("task.properties").getProperty("status");
        if(status.equals("open")) {
            logger.info("===========>每隔3秒执行quart定时任务:" + new Date());
        }
    }


    @Override
    protected void executeInternal(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        this.work();
    }
}
